package com.TocaLetras;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;

public class TocaLetrasActivity extends Activity{
    /** Called when the activity is first created. */
	private ImageButton  b_ayuda;
	private ImageButton  b_jugar;
	private ImageButton  btn_ajustes;
	private ImageButton  b_salir;
	private final int SECONDARY_ACTIVITY_REQUEST_CODE=0;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu);
        addListeners();
        
        //Create, Initialise and then load the Sound manager
        SoundManager.getInstance();
        SoundManager.initSounds(this);
        SoundManager.loadSounds();
    }
    
    @Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    	super.onActivityResult(requestCode,resultCode,data);
    }
    
    public void addListeners(){  	 
         b_jugar = (ImageButton) findViewById(R.id.btn_juego_nuevo);
         b_jugar.setOnClickListener(new View.OnClickListener() {
  			
  			public void onClick(View v) {
  				SoundManager.playSound(4);
  				Intent inten = new Intent(getApplicationContext(),JuegoPrincipalActivity.class);
  				inten.putExtra("mkey","Hola");
  				startActivityForResult(inten,SECONDARY_ACTIVITY_REQUEST_CODE);
  			}
  		});
         
         btn_ajustes = (ImageButton) findViewById(R.id.btn_continuar);
         btn_ajustes.setOnClickListener(new View.OnClickListener() {
  			
  			public void onClick(View v) {
  				
  			}
  		});
         
         b_ayuda = (ImageButton) findViewById(R.id.btn_ayuda);
         b_ayuda.setOnClickListener(new View.OnClickListener() {
  			
  			public void onClick(View v) {
  				Intent inten = new Intent(getApplicationContext(),AyudaActivity.class);
  				inten.putExtra("mkey","Hola");
  				startActivityForResult(inten,SECONDARY_ACTIVITY_REQUEST_CODE);
  			}
  		});
         
         b_salir = (ImageButton)findViewById(R.id.btn_salir);
         b_salir.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				SoundManager.cleanup();
				finish();
			}
		});
     }
}